package com.pizza.adapter;


import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.ArrayList;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import com.pizza.gui.PizzeriaGui;
import com.pizza.spring.rmi.Adres;
import com.pizza.spring.rmi.Produkt;
import com.pizza.spring.rmi.User;
import com.pizza.spring.rmi.Zamowienie;


public class ZamowienieRow extends JPanel implements MouseListener{
	AdapterListPizzeria adapterProdukty ;
	AdapterList zamowienieList = new AdapterList(10000, 10000, null);
	private Produkt pizza;
	PizzeriaGui fram;
	JButton zamow = new JButton("Zamow");
	public JButton getZamow() {
		return zamow;
	}
	public ZamowienieRow( PizzeriaGui fram, User user,Adres adres,String adresZamowienia,ArrayList<Produkt >produkt){
		
		this.pizza=pizza;
		this.fram=fram;
		adapterProdukty= new AdapterListPizzeria(fram,10000, 10000, null);
		int h=154, w=600;
	setLayout(null);
	setVisible(true);
	setPreferredSize(new Dimension(10000, 50));
	
	JLabel setName = new JLabel();
	//next page to bedziew adapter do wyswietlania
	setName.setBackground(Color.blue);
	//setName.setOpaque(true);
	String s =user.getLogin()+"  "+adresZamowienia+adres.getName()+adres.getLastname();
	for (Produkt produkt2 : produkt) {
		s+=produkt2.getName()+"  "+produkt2.getDescriptions()+"  ";
	}
	setName.setText(s);
	setName.setBounds(		10, 	15,		w, 		50);
	add(setName);
	}
	
	@Override
	public void mouseClicked(MouseEvent arg0) {
		//znalezc zamowienie row
	}
	@Override
	public void mouseEntered(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void mouseExited(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void mousePressed(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void mouseReleased(MouseEvent e) {
		// TODO Auto-generated method stub
		
	}
}
